package com.gitee.mrj.aiboot.annotation.config.sf.ui;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.TYPE})
@Documented
public @interface ACLType {
    /**
     * 角色
     */
    String[] role() default {};

    /**
     * 权限点
     */
    String[] ability() default {};

    /**
     * Validated against, default: `oneOf`
     * - `allOf` the value validates against all the roles or abilities
     * - `oneOf` the value validates against exactly one of the roles or abilities
     */
    boolean allOf() default false;

    boolean oneOf() default true;

    /**
     * 是否取反，即结果为 `true` 时表示未授权
     */
    boolean except() default false;

}
